package cn.zswltech.gruul.common.dal.dao;

import cn.zswltech.gruul.common.dal.query.UserQuery;
import cn.zswltech.gruul.common.dal.tkmybatis.IMapper;
import cn.zswltech.gruul.common.entity.UserDO;
import cn.zswltech.gruul.common.entity.UserOrgRoleDO;
import cn.zswltech.gruul.common.dal.vo.OrgRoleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @create: 2022-07-19
 **/
@Mapper
public interface UserOrgRoleDOMapper extends IMapper<UserOrgRoleDO> {

    int delByUserIdRoleId(@Param("userId")  Long userId, @Param("roleId")  Long roleId);

    List<Long> selectUserIdByOrgIdAndRoleId(@Param("orgId") Long orgId, @Param("roleId") Long roleId);

    List<Long> selectRoleIdsByUserId(@Param("userId") Long userId);

    List<Long> selectOrgIdsByUserId(@Param("userId") Long userId);

    List<OrgRoleVO> selectOrgAndRoleInfo(@Param("userIds") List<Long> userIds);

    List<Long> selectUserIdByQuery(UserQuery query);

    List<UserDO> selectUserDOByOrgId(@Param("orgIds") Set<Long> orgIds);
}
